package ch.zhaw.skuh.turing.view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import ch.zhaw.skuh.turing.controller.Controller;

public class StepButton extends JButton {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4650820106482476533L;
	private Controller controller;
	
	private int stepCount;

	public StepButton(Controller ctrl, int steps, String text) {
		super(text);
		this.controller = ctrl;
		this.stepCount = steps;
		addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				controller.showStep(stepCount);
			}
		});
	}

}
